Skip to content

Conversation

@ntsekouras
Copy link

Trac ticket: https://core.trac.wordpress.org/ticket/57532

This PR adds the pattern categories migration in WP_REST_Block_Patterns_Controller.
Related GB PR: WordPress/gutenberg#46144.
Part of the GB PR was merged in this changeset: https://core.trac.wordpress.org/changeset/55098


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

* Unwraps nested blocks for readability.

* Moves the bail out code to the top for increased understanding of its purpose.

* Adds inline comments for readability.

* Performance: switches from `array_key_exists()` to `isset()`.
Why? In this use case, `null` is not a concern. `isset()` is slightly more performant.
Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code matches the changes in GB 46144 and the added test method. LGTM 👍

@hellofromtonya
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants